package net.ipinglun.module.main;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

import com.facebook.drawee.view.SimpleDraweeView;

import net.ipinglun.R;


public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏

        setContentView(R.layout.activity_splash);


        SimpleDraweeView splashImg = (SimpleDraweeView) findViewById(R.id.splash_img);
        //splashImg.setImageURI(Uri.parse("http://news.mydrivers.com/img/20131014/5eaf3e54c34141718455ca96e6895904.png"));
        //splashImg.setImageURI(Uri.parse("http://img5.duitang.com/uploads/item/201409/07/20140907223746_uGwUs.jpeg"));
        //  http://img4.duitang.com/uploads/item/201409/07/20140907222719_xFtkV.jpeg

        splashImg.setImageURI(Uri.parse("http://attach.bbs.miui.com/forum/201502/04/172701miz0kccvu4gu0vi4.jpg"));
        Handler handler = new Handler();
        Runnable runnable = new Runnable() {
            public void run() {
                jump();
            }
        };
        handler.postDelayed(runnable, 3000);

    }

    public void jump() {

        Intent intent = new Intent(SplashActivity.this, MainActivity.class);
        SplashActivity.this.startActivity(intent);

        finish();


    }

}
